package com.thx.app.remote.model;

import java.io.Serializable;
import com.thx.app.remote.UserLoginInter;
import com.thx.app.remote.model.RPCResponse;

public class UserInfor_ implements Serializable {
	private static final long serialVersionUID = 6298517228624214371L;
	
	private String userId;
	private String userName;
	private String realName;
	private String mobilePhone;
	private String email;
	private String userLogo;
	
	private String depId;
	private String depName;
	
	private String password;
	
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getRealName() {
		return realName;
	}
	public void setRealName(String realName) {
		this.realName = realName;
	}
	public String getMobilePhone() {
		return mobilePhone;
	}
	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getUserLogo() {
		return userLogo;
	}
	public void setUserLogo(String userLogo) {
		this.userLogo = userLogo;
	}
	public String getDepId() {
		return depId;
	}
	public void setDepId(String depId) {
		this.depId = depId;
	}
	public String getDepName() {
		return depName;
	}
	public void setDepName(String depName) {
		this.depName = depName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	public static UserInfor_ getUserByRpcResponse(RPCResponse response){
		UserInfor_ user = new UserInfor_();
		user.setUserId(response.getAttribute(UserLoginInter.SK_USERID));
		user.setUserName(response.getAttribute(UserLoginInter.SK_USERNAME));
		user.setRealName(response.getAttribute(UserLoginInter.SK_REALNAME));
		user.setDepId(response.getAttribute(UserLoginInter.SK_DEPID));
		user.setDepName(response.getAttribute(UserLoginInter.SK_DEPNAME));
		user.setUserLogo(response.getAttribute(UserLoginInter.SK_USERLOGO));
		user.setMobilePhone(response.getAttribute(UserLoginInter.SK_MOBILE));
		return user;
	}
}
